package dao;


import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import pojo.paymentM;

import java.util.List;

@Component
public interface PayMapper {

    @Select("select id,stu_id,term,clazz,name,payment,arrearage from payment_m")
    List<paymentM> getAll();

    @Select("select * from payment_m where stu_id = #{stuId}")
    paymentM getOne(int stuId);

    @Update("update payment_m set stu_id=#{stuId},term=#{term},clazz=#{clazz},name=#{name},payment=#{payment},arrearage=#{arrearage} where stu_id = #{stuId}")
    Integer update(paymentM paymentM1);

    @Delete("delete from payment_m where id = #{id}")
    Integer del(String id);

    @Insert("INSERT INTO payment_m (id,stu_id,term,clazz,name,payment,arrearage) VALUES (#{id},#{stuId},#{term},#{clazz},#{name},#{payment},#{arrearage})")
    Integer add(paymentM paymentM);

}
